#ifdef G_ENABLE_DEBUG
if (gdk_profiler_is_running ())
gdk_profiler_set_int_counter (pixels_counter,
- g_get_monotonic_time () * 1000,
+ g_get_monotonic_time (),
region_get_pixels (priv->frame_region));
#endif
if (gdk_profiler_is_running ())
{
gint64 after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "flush-events");
+ gdk_profiler_add_mark (before, (after - before), "frameclock", "flush-events");
}
}
if (gdk_profiler_is_running ())
{
gint64 after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "before-paint");
+ gdk_profiler_add_mark (before, (after - before), "frameclock", "before-paint");
}
}
if (gdk_profiler_is_running ())
{
gint64 after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "update");
+ gdk_profiler_add_mark (before, (after - before), "frameclock", "update");
}
}
if (gdk_profiler_is_running ())
{
gint64 after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "layout");
+ gdk_profiler_add_mark (before, (after - before), "frameclock", "layout");
}
}
if (gdk_profiler_is_running ())
{
gint64 after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "paint");
+ gdk_profiler_add_mark (before, (after - before), "frameclock", "paint");
}
}
if (gdk_profiler_is_running ())
{
gint64 after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "after-paint");
+ gdk_profiler_add_mark (before, (after - before), "frameclock", "after-paint");
}
}
if (gdk_profiler_is_running ())
{
gint64 after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "frameclock", "resume-events");
+ gdk_profiler_add_mark (before, (after - before), "frameclock", "resume-events");
}
}
{
if (timings->presentation_time != 0)
{
- gdk_profiler_add_mark (timings->presentation_time * 1000, 0, "frameclock", "presentation");
+ gdk_profiler_add_mark (timings->presentation_time, 0, "frameclock", "presentation");
gdk_profiler_set_counter (fps_counter,
- timings->presentation_time * 1000,
+ timings->presentation_time,
frame_clock_get_fps (clock));
}
}
priv->sleep_serial = get_sleep_serial ();
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "frameclock", "paint_idle");
+ gdk_profiler_add_mark (before, (g_get_monotonic_time () - before), "frameclock", "paint_idle");
return FALSE;
}
if (priv->freeze_time != 0)
{
gint64 thaw_time = g_get_monotonic_time ();
- gdk_profiler_add_mark (priv->freeze_time * 1000,
- (thaw_time - priv->freeze_time) * 1000,
+ gdk_profiler_add_mark (priv->freeze_time,
+ (thaw_time - priv->freeze_time),
"frameclock freeze", "");
priv->freeze_time = 0;
}
return;
sysprof_capture_writer_add_mark (writer,
- start,
+ start * 1000L,
-1, getpid (),
- duration,
+ duration * 1000L,
"gtk", name, message);
}
va_end (args);
sysprof_capture_writer_add_mark (writer,
- start,
+ start * 1000L,
-1, getpid (),
- duration,
+ duration * 1000L,
"gtk", name, message);
g_free (message);
}
value.vdbl = val;
sysprof_capture_writer_set_counters (writer,
- time,
+ time * 1000L,
-1, getpid (),
&id, &value, 1);
}
value.v64 = val;
sysprof_capture_writer_set_counters (writer,
- time,
+ time * 1000L,
-1, getpid (),
&id, &value, 1);
}
}
if (kind != NULL && message != NULL)
- gdk_profiler_add_markf (time * 1000L, duration * 1000L, "event", "%s %s", kind, message);
+ gdk_profiler_add_markf (time, duration, "event", "%s %s", kind, message);
else
- gdk_profiler_add_mark (time * 1000L, duration * 1000L, "event", message ? message : kind);
+ gdk_profiler_add_mark (time, duration, "event", message ? message : kind);
g_free (message);
}
if (gdk_profiler_is_running ())
{
- gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "wayland", "load cursor theme");
+ gdk_profiler_add_mark (before, (g_get_monotonic_time () - before), "wayland", "load cursor theme");
}
}
gdk_wayland_surface_sync (surface);
gdk_wayland_surface_request_frame (surface);
- gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "wayland", "swap buffers");
+ gdk_profiler_add_mark (g_get_monotonic_time (), 0, "wayland", "swap buffers");
if (display_wayland->have_egl_swap_buffers_with_damage)
{
int i, j, n_rects = cairo_region_num_rectangles (painted);
GdkFrameClock *clock = gdk_surface_get_frame_clock (surface);
GdkFrameTimings *timings;
- gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "wayland", "frame event");
+ gdk_profiler_add_mark (g_get_monotonic_time (), 0, "wayland", "frame event");
GDK_DISPLAY_NOTE (GDK_DISPLAY (display_wayland), EVENTS, g_message ("frame %p", surface));
wl_callback_destroy (callback);
* before we need to stage any changes, then we can take it back and
* use it again.
*/
- gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "wayland", "surface commit");
+ gdk_profiler_add_mark (g_get_monotonic_time (), 0, "wayland", "surface commit");
wl_surface_commit (impl->display_server.wl_surface);
impl->pending_commit = FALSE;
if (impl->hint == GDK_SURFACE_TYPE_HINT_DIALOG)
_gdk_wayland_screen_add_orphan_dialog (surface);
- gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "wayland", "surface commit");
+ gdk_profiler_add_mark (g_get_monotonic_time (), 0, "wayland", "surface commit");
wl_surface_commit (impl->display_server.wl_surface);
}
}
}
- gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "wayland", "surface commit");
+ gdk_profiler_add_mark (g_get_monotonic_time (), 0, "wayland", "surface commit");
wl_surface_commit (impl->display_server.wl_surface);
impl->popup_parent = parent;
else
elapsed = 0;
- return elapsed;
+ return elapsed / 1000; /* Convert to usec to match other profiler APIs */
}
gsk_gl_shadow_cache_init (&self->shadow_cache);
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "gl renderer realize", NULL);
+ gdk_profiler_add_mark (before, (g_get_monotonic_time () - before), "gl renderer realize", NULL);
return TRUE;
}
return;
timer->in_flight = TRUE;
- timer->start_time = g_get_monotonic_time () * 1000;
+ timer->start_time = g_get_monotonic_time ();
}
gint64
return 0;
}
- diff = (g_get_monotonic_time () * 1000) - timer->start_time;
+ diff = g_get_monotonic_time () - timer->start_time;
timer->in_flight = FALSE;
timer->value += diff;
}
if (timer->invert)
- return (gint64) (1000000000.0 / (double) timer->value);
+ return (gint64) (1000000.0 / (double) timer->value);
return timer->value;
}
s->id = timer->id;
if (timer->invert)
- s->value = (gint64) (1000000000.0 / (double) timer->value);
+ s->value = (gint64) (1000000.0 / (double) timer->value);
else
s->value = timer->value;
}
{
NamedTimer *timer = value_p;
const char *unit = timer->invert ? "" : "usec";
- double scale = timer->invert ? 1.0 : 1000.0;
g_string_append_printf (buffer, "%s (%s): %.2f",
timer->description,
unit,
- (double) timer->value / scale);
+ (double) timer->value);
if (timer->n_samples > 1)
{
timer->avg_value = timer->avg_value / timer->n_samples;
g_string_append_printf (buffer, " Min: %.2f Avg: %.2f Max: %.2f (%" G_GINT64_FORMAT " samples)",
- (double) timer->min_value / scale,
- (double) timer->avg_value / scale,
- (double) timer->max_value / scale,
+ (double) timer->min_value,
+ (double) timer->avg_value,
+ (double) timer->max_value,
timer->n_samples);
}
before2 = g_get_monotonic_time ();
gtk_init ();
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before2 * 1000, (g_get_monotonic_time () - before2) * 1000, "gtk init", NULL);
+ gdk_profiler_add_mark (before2, (g_get_monotonic_time () - before2), "gtk init", NULL);
priv->impl = gtk_application_impl_new (application, gdk_display_get_default ());
gtk_application_impl_startup (priv->impl, priv->register_session);
gtk_application_load_resources (application);
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "gtk application startup", NULL);
+ gdk_profiler_add_mark (before, (g_get_monotonic_time () - before), "gtk application startup", NULL);
}
static void
/* restore the original domain */
gtk_builder_set_translation_domain (builder, domain);
- gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "builder load", filename);
+ gdk_profiler_add_mark (before, (g_get_monotonic_time () - before), "builder load", filename);
}
if (gdk_profiler_is_running ())
{
gint64 after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "css validation", "");
- gdk_profiler_set_int_counter (invalidated_nodes_counter, after * 1000, invalidated_nodes);
- gdk_profiler_set_int_counter (created_styles_counter, after * 1000, created_styles);
+ gdk_profiler_add_mark (before, (after - before), "css validation", "");
+ gdk_profiler_set_int_counter (invalidated_nodes_counter, after, invalidated_nodes);
+ gdk_profiler_set_int_counter (created_styles_counter, after, created_styles);
invalidated_nodes = 0;
created_styles = 0;
}
#endif
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "create selector tree", NULL);
+ gdk_profiler_add_mark (before, (g_get_monotonic_time () - before), "create selector tree", NULL);
}
static void
if (gdk_profiler_is_running ())
{
char *uri = g_file_get_uri (file);
- gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "theme load", uri);
+ gdk_profiler_add_mark (before, (g_get_monotonic_time () - before), "theme load", uri);
g_free (uri);
}
}
if (now > start + 8000)
{
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (start * 1000, (now - start) * 1000, "emojichooser", "populate");
+ gdk_profiler_add_mark (start, (now - start), "emojichooser", "populate");
return G_SOURCE_CONTINUE;
}
}
if (gdk_profiler_is_running ())
{
now = g_get_monotonic_time ();
- gdk_profiler_add_mark (start * 1000, (now - start) * 1000, "emojichooser", "populate (finish)");
+ gdk_profiler_add_mark (start, (now - start), "emojichooser", "populate (finish)");
}
return G_SOURCE_REMOVE;
load_themes (self);
if (gdk_profiler_is_running ())
- gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "icon theme load", self->current_theme);
+ gdk_profiler_add_mark (before, (g_get_monotonic_time () - before), "icon theme load", self->current_theme);
if (was_valid)
queue_theme_changed (self);
g_assert (icon->texture != NULL);
if (gdk_profiler_is_running ())
- gdk_profiler_add_markf (before * 1000, (g_get_monotonic_time () - before) * 1000, in_thread ? "icon load (thread)" : "icon load" , "%s size %d@%d", icon->filename, icon->desired_size, icon->desired_scale);
+ gdk_profiler_add_markf (before, g_get_monotonic_time () - before, in_thread ? "icon load (thread)" : "icon load" ,
+ "%s size %d@%d", icon->filename, icon->desired_size, icon->desired_scale);
}
static GdkTexture *
if (gdk_profiler_is_running ())
{
after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "widget snapshot", "");
+ gdk_profiler_add_mark (before, (after - before), "widget snapshot", "");
}
if (root != NULL)
{
before = after;
after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "widget render", "");
+ gdk_profiler_add_mark (before, (after - before), "widget render", "");
}
}
}
if (gdk_profiler_is_running ())
{
gint64 after = g_get_monotonic_time ();
- gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "size allocation", "");
+ gdk_profiler_add_mark (before, (after - before), "size allocation", "");
}
}